Optimal. Leaf size=113 \[ \frac {3 \tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {a+a \sin (e+f x)}}\right )}{a^{3/2} f}-\frac {2 \sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {2} \sqrt {a+a \sin (e+f x)}}\right )}{a^{3/2} f}-\frac {\cot (e+f x)}{a f \sqrt {a+a \sin (e+f x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.15, antiderivative size = 113, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 5, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {2794, 3064,
2728, 212, 2852} \begin {gather*} \frac {3 \tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {a \sin (e+f x)+a}}\right )}{a^{3/2} f}-\frac {2 \sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {2} \sqrt {a \sin (e+f x)+a}}\right )}{a^{3/2} f}-\frac {\cot (e+f x)}{a f \sqrt {a \sin (e+f x)+a}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 2728
Rule 2794
Rule 2852
Rule 3064
Rubi steps
\begin {align*} \int \frac {\cot ^2(e+f x)}{(a+a \sin (e+f x))^{3/2}} \, dx &=-\frac {\cot (e+f x)}{a f \sqrt {a+a \sin (e+f x)}}+\frac {\int \frac {\csc (e+f x) \left (-\frac {3 a}{2}+\frac {1}{2} a \sin (e+f x)\right )}{\sqrt {a+a \sin (e+f x)}} \, dx}{a^2}\\ &=-\frac {\cot (e+f x)}{a f \sqrt {a+a \sin (e+f x)}}-\frac {3 \int \csc (e+f x) \sqrt {a+a \sin (e+f x)} \, dx}{2 a^2}+\frac {2 \int \frac {1}{\sqrt {a+a \sin (e+f x)}} \, dx}{a}\\ &=-\frac {\cot (e+f x)}{a f \sqrt {a+a \sin (e+f x)}}+\frac {3 \text {Subst}\left (\int \frac {1}{a-x^2} \, dx,x,\frac {a \cos (e+f x)}{\sqrt {a+a \sin (e+f x)}}\right )}{a f}-\frac {4 \text {Subst}\left (\int \frac {1}{2 a-x^2} \, dx,x,\frac {a \cos (e+f x)}{\sqrt {a+a \sin (e+f x)}}\right )}{a f}\\ &=\frac {3 \tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {a+a \sin (e+f x)}}\right )}{a^{3/2} f}-\frac {2 \sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {2} \sqrt {a+a \sin (e+f x)}}\right )}{a^{3/2} f}-\frac {\cot (e+f x)}{a f \sqrt {a+a \sin (e+f x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 1.51, size = 206, normalized size = 1.82 \begin {gather*} \frac {\left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )^3 \left ((16+16 i) (-1)^{3/4} \tanh ^{-1}\left (\left (\frac {1}{2}+\frac {i}{2}\right ) (-1)^{3/4} \left (-1+\tan \left (\frac {1}{4} (e+f x)\right )\right )\right )-\cot \left (\frac {1}{4} (e+f x)\right )+2 \left (3 \log \left (1+\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )-3 \log \left (1-\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )+\sec \left (\frac {1}{2} (e+f x)\right )+\csc (e+f x) \sin ^2\left (\frac {1}{4} (e+f x)\right )-\csc (e+f x) \sin \left (\frac {1}{4} (e+f x)\right ) \sin \left (\frac {3}{4} (e+f x)\right )\right )\right )}{4 f (a (1+\sin (e+f x)))^{3/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 2.47, size = 135, normalized size = 1.19
method | result | size |
default | \(-\frac {\left (1+\sin \left (f x +e \right )\right ) \sqrt {-a \left (\sin \left (f x +e \right )-1\right )}\, \left (-\sin \left (f x +e \right ) a^{2} \left (-2 \sqrt {2}\, \arctanh \left (\frac {\sqrt {a -a \sin \left (f x +e \right )}\, \sqrt {2}}{2 \sqrt {a}}\right )+3 \arctanh \left (\frac {\sqrt {a -a \sin \left (f x +e \right )}}{\sqrt {a}}\right )\right )+\sqrt {a -a \sin \left (f x +e \right )}\, a^{\frac {3}{2}}\right )}{a^{\frac {7}{2}} \sin \left (f x +e \right ) \cos \left (f x +e \right ) \sqrt {a +a \sin \left (f x +e \right )}\, f}\) | \(135\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 460 vs.
\(2 (102) = 204\).
time = 0.39, size = 460, normalized size = 4.07 \begin {gather*} \frac {3 \, {\left (\cos \left (f x + e\right )^{2} - {\left (\cos \left (f x + e\right ) + 1\right )} \sin \left (f x + e\right ) - 1\right )} \sqrt {a} \log \left (\frac {a \cos \left (f x + e\right )^{3} - 7 \, a \cos \left (f x + e\right )^{2} + 4 \, {\left (\cos \left (f x + e\right )^{2} + {\left (\cos \left (f x + e\right ) + 3\right )} \sin \left (f x + e\right ) - 2 \, \cos \left (f x + e\right ) - 3\right )} \sqrt {a \sin \left (f x + e\right ) + a} \sqrt {a} - 9 \, a \cos \left (f x + e\right ) + {\left (a \cos \left (f x + e\right )^{2} + 8 \, a \cos \left (f x + e\right ) - a\right )} \sin \left (f x + e\right ) - a}{\cos \left (f x + e\right )^{3} + \cos \left (f x + e\right )^{2} + {\left (\cos \left (f x + e\right )^{2} - 1\right )} \sin \left (f x + e\right ) - \cos \left (f x + e\right ) - 1}\right ) + \frac {4 \, \sqrt {2} {\left (a \cos \left (f x + e\right )^{2} - {\left (a \cos \left (f x + e\right ) + a\right )} \sin \left (f x + e\right ) - a\right )} \log \left (-\frac {\cos \left (f x + e\right )^{2} - {\left (\cos \left (f x + e\right ) - 2\right )} \sin \left (f x + e\right ) - \frac {2 \, \sqrt {2} \sqrt {a \sin \left (f x + e\right ) + a} {\left (\cos \left (f x + e\right ) - \sin \left (f x + e\right ) + 1\right )}}{\sqrt {a}} + 3 \, \cos \left (f x + e\right ) + 2}{\cos \left (f x + e\right )^{2} - {\left (\cos \left (f x + e\right ) + 2\right )} \sin \left (f x + e\right ) - \cos \left (f x + e\right ) - 2}\right )}{\sqrt {a}} + 4 \, \sqrt {a \sin \left (f x + e\right ) + a} {\left (\cos \left (f x + e\right ) - \sin \left (f x + e\right ) + 1\right )}}{4 \, {\left (a^{2} f \cos \left (f x + e\right )^{2} - a^{2} f - {\left (a^{2} f \cos \left (f x + e\right ) + a^{2} f\right )} \sin \left (f x + e\right )\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\cot ^{2}{\left (e + f x \right )}}{\left (a \left (\sin {\left (e + f x \right )} + 1\right )\right )^{\frac {3}{2}}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 215 vs.
\(2 (102) = 204\).
time = 5.31, size = 215, normalized size = 1.90 \begin {gather*} \frac {\sqrt {2} \sqrt {a} {\left (\frac {3 \, \sqrt {2} \log \left (\frac {{\left | -2 \, \sqrt {2} + 4 \, \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right ) \right |}}{{\left | 2 \, \sqrt {2} + 4 \, \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right ) \right |}}\right )}{a^{2} \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )} + \frac {4 \, \log \left (\sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}{a^{2} \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )} - \frac {4 \, \log \left (-\sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}{a^{2} \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )} - \frac {4 \, \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{{\left (2 \, \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 1\right )} a^{2} \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}\right )}}{4 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\mathrm {cot}\left (e+f\,x\right )}^2}{{\left (a+a\,\sin \left (e+f\,x\right )\right )}^{3/2}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________